@model string
@using NITASA.ViewModels
@{
    CL_WidgetOption wOption = NITASA.Helpers.Functions.ParseJson<CL_WidgetOption>(Model);
    List<CL_Content> RecentViewPosts = NITASA.Helpers.Functions.GetRecentViewPosts(wOption.Count);
}

@if (RecentViewPosts.Count() > 0)
{
    <div class="sidebar-box">
        <h4>@wOption.Title</h4>
        <ul class="latest-posts">
            @foreach (var item in RecentViewPosts)
{
    <li style="min-height:35px;">
        <span class="date">
            <em class="day">@NITASA.Helpers.Functions.GetDay(item.PublishedOn)</em>
            <em class="month">@NITASA.Helpers.Functions.GetMonthName(item.PublishedOn)</em>
        </span>
        <a href="/Content/@item.URL">
            @{string Description = NITASA.Helpers.Functions.RemoveHTMLTags(item.Description);}
            @(Description.Length > 80 ? Description.Substring(0, 80) + "..." : Description)
        </a>
    </li>
}
            </ul>
</div>
}
